The HQOS technology achieves multi-user multi-service bandwidth guarantees under the Differentiated Service (Diff-Serv) model through hierarchical scheduling. The structure of a HQOS service tree, as shown in FIG. 1, comprises a port layer, a user group layer, a user layer, a service layer of a total of four layers. The HQOS service tree can embody a tree-liked topology structure and service forwarding paths of a subnet accessing a network through application ports, after being bound with the application ports, and messages of the subnet can be hierarchically scheduled through the HQOS service tree, achieving functions such as congestion avoidance, multi-level scheduling, traffic rate-limiting and traffic statistics, and guaranteeing the bandwidth for each user and each service in an actual network.
At present, three HQOS services i.e., binding, de-binding and updating are used to bind the HQOS service tree and the application ports, revoke the binding between the HQOS service tree and the application ports, or update the HQOS service tree according to the variations of the network structure or associated parameters of the subnet, wherein, the updating HQOS service specifically comprises: a sub-tree adding service, a sub-tree deleting service, a master parameter updating service and a slave parameter updating service, and the device to specifically implement the above HQOS services comprises:
a service management module, which is used to receive service types and service processing information, invoke the service resource management module corresponding to the received service types, and send the received service processing information to the invoked service resource management module, wherein, the service resource management module comprises: a binding module, a de-binding module, a sub-tree adding module, a sub-tree deleting module, a master parameter updating module, and a slave parameter updating module; wherein,
the binding module is used to invoke a service tree generating function to generate the HQOS service tree; invoke a table management function to write a software table according to the received service processing information; invoke a tree traversing function to traverse the generated HQOS service tree, and record the next traversed position each time one branch is traversed, and invoke a buffer processing function and a hardware management function to apply and assign resources for each node of the traversed branch, invoke the table management function to write a configuration table according to the received service processing information, then invoke the traversing function again to continue to traverse the generated HQOS service tree from the recorded traversed position;
the de-binding module is used to determine an object service tree according to application ports and application directions in the received service processing information; invoke the table management function to delete table items corresponding to the object service tree; invoke the tree traversing function to traverse the object service tree, and record the next traversed position each time one branch is traversed, invoke the hardware management function and the buffer processing function to release the resources of each node of the traversed branch, invoke the table management function to delete the configuration table corresponding to the traversed branch, then invoke the traversing function again to continue to traverse the object service tree from the recorded traversed position;
the sub-tree adding module is used to determine the object service tree according to the application ports and the application directions in the received service processing information; determine a sub-tree to be added according to relative offsets between the layer where the nodes are located and the nodes in the received service processing information; invoke the tree traversing function to traverse the sub-tree to be added, and record the next traversed position each time one branch is traversed, invoke the buffer processing function and the hardware management function to apply and assign resources for each node of the traversed branch, invoke the table management function to write the configuration table according to the received service processing information, then invoke the traversing function again to continue to traverse the sub-tree to be added from the recorded traversed position;
the sub-tree deleting module is used to determine the object service tree according to the application ports and the application directions in the received service processing information; determine the sub-tree to be deleted according to relative offsets between the layer where the nodes are located and the nodes in the received service processing information; invoke the tree traversing function to traverse the sub-tree to be deleted, and record the next traversed position each time one branch is traversed, invoke the hardware management function and the buffer processing function to release the resources of each node of the traversed tree, invoke the table management function to delete the configuration table corresponding to the traversed branch, then invoke the traversing function again to continue to traverse the sub-tree to be deleted from the recorded traversed position;
the master parameter updating module is used to determine the object service tree according to the application ports and the application directions in the received service processing information; determine the nodes of which the QOS master parameters need to be updated according to relative offsets between the layer where the nodes are located and the nodes in the received service processing information, invoke the table management function to delete table items including the QOS master parameters on the determined nodes in the configuration table, substitute the QOS master parameters in the received service processing information for the corresponding QOS master parameters on the determined nodes, and write the paths passing through the determined nodes into the configuration table, i.e., writing the QOS master parameter of each node on the paths into the configuration table;
the slave parameter updating module is used to determine the object service tree according to the application ports and the application directions in the received service processing information; determine the nodes of which the QOS slave parameters need to be updated according to relative offsets between the layer where the nodes are located and the nodes in the received service processing information, invoke the buffer processing function to acquire the QOS slave parameters of the nodes from the received service processing information, substitute the acquired QOS slave parameters for the corresponding QOS slave parameters buffered in the determined nodes, and invoke the hardware management function to update the hardware resources of the nodes according to the QOS slave parameters after the substitution.
It can be seen that the above device for enabling HQOS services has the following drawbacks:
each HQOS service is implemented by a corresponding independent service resource management module, but a part of the implementation processes of various HQOS services are similar, which makes a part of functions of different service resource management modules be similar, for example, all of the binding module, de-binding module, sub-tree adding module and sub-tree deleting module need to invoke the tree traversing function many times and maintain the traversed position, both the binding module and the sub-tree adding module need to perform the operations for applying and assigning resources for nodes, both the de-binding module and the sub-tree deleting module need to perform the operations for releasing the resources for nodes, and so on, thus making a large number of repeated codes be within the software codes for implementing each service resource management module respectively, increasing the complexity of the codes and the difficulty in maintaining the codes, and therefore, the efficiency of processing the HQOS services is low.